<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/7/24
 * Time: 15:51
 */

/**
 * 读取文件
 * __DIR__
 */
$result = swoole_async_readfile(__DIR__ . "/1.txt", function ($filename, $fileContent) {
    echo "filename:" . $filename . PHP_EOL; //PHP_EOL  PHP自带换行符
    echo "content:" . $fileContent . PHP_EOL;
});
//执行顺序是先去执swoole_async_readfile(__DIR__ . "/1.txt",找文件，然后返回给result
//再之下下面代码，最后处理function ($filename, $fileContent) {}回调函数输出内容
var_dump($result);

echo "start".PHP_EOL;